/*
 * 全局store
 *
 * @Author: 谢力 843926058@qq.com
 * @Date:   2018-11-08 14:08:51
 * @Last Modified by:   谢力
 * @Last Modified time: 2019-11-08 14:08:56
 */
import { LocalStorage } from "@/utils/storage";

export default {
  /* 是否登录 */
  isLogin: false,

  /* token */
  token: LocalStorage.read("__token__"),

  /* 账户 */
  account: LocalStorage.read("__account__"),

  /* 用户信息 */
  userInfo: LocalStorage.read("__userInfo__"),

  /* 用户权限匹配菜单 */
  menuList: LocalStorage.read("__menuList__"),

  /* 用户权限匹配路由 */
  routeList: null,

  /* 是否动态加载过菜单 */
  loadMenued: false,

  /* 语言 */
  language: "zh-CN",

  /* 字典 */
  dictionary: {
    ship_type: [
      { ship_state: "0", ship_name: "有数据加载" },
      { ship_state: "1", ship_name: "无数据提示1" },
      { ship_state: "2", ship_name: "无数据提示2" },
    ],

    is_send_2_home: {
      0: "支持",
      1: "不支持",
    },

    state: {
      112: "未完成",
      113: "已提交",
      114: "已审核",
      211: "自用中",
      212: "存储中",
      213: "已退箱",
      214: "已退金",
      215: "取回中",
      0: "已发货",
      1: "已支付",
      3: "配货中",
      4: "已签收",
      5: "已取消",
      7: "待支付",
      8: "支付失败",
      9: "退货中",
      10: "已退款",
      11: "已取回",
      12: "已入库",
      14: "支付失败",
    },

    express: {
      0: "T+0",
      1: "T+1",
    },

    sex: {
      0: "保密",
      1: "男",
      2: "女",
    },

    payment: {
      0: "线下支付",
      1: "在线支付",
    },

    symbol: {
      0: "－",
      1: "＋",
    },

    user_type: {
      0: "普通用户",
      111: "普通店员",
      112: "店长",
      113: "运营总监",
    },

    goods_storetype: {
      0: "冷冻",
      1: "冷藏",
      2: "常温",
    },

    score_type: {
      1: "用户消费扣除",
      2: "门店消费扣除",
      3: "供应商消费扣除",
      4: "新用户注册奖励",
      5: "推荐注册奖励老用户",
      6: "用户自己充值获取奖励",
      7: "消费赠送推荐者",
      8: "消费赠送给自己",
      9: "活动积分",
      10: "平台充值",
    },

    consume_type: {
      1: "下单",
      2: "充值",
      3: "赠送",
      4: "结算",
    },

    type_promotion: {
      0: "促销",
      1: "不促销",
    },

    type_4_kinds: {
      1: "实体商品",
      2: "虚拟商品",
      3: "服务类别",
    },

    type_register_goods: {
      1: "统价上架",
      2: "供应商决定",
    },

    type_of_shipment: {
      1: "到店自取",
      2: "送货到家",
    },

    hard_level: {
      0: "暂未明确",
      1: "自提客户",
      2: "白天有人",
      3: "晚上有人",
      4: "全天可送",
      5: "轻微抱怨",
      6: "立即送达",
      7: "行动不便",
      8: "常年投诉",
      9: "难度超大",
    },

    discount: {
      104: "新人券",
      109: "满减券",
      106: "会员充值券",
    },

    // 小程序跳转路由配置（每个项目有所不同）
    jumpUrl: {
      // 商品详情
      1: {
        path: "/category/detail",
        key: ["id"],
      },
      // 个人中心
      2: {
        path: "/front_page_index?redirect=my",
        key: [],
      },
      // 活动签到管理模块
      3: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod_activity_sign_vue/dist/front_page_index.html",
        key: [],
      },
      // 排班模块
      4: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod_schedule_system_vue/dist/front_page_index.html",
        key: [],
      },
      // 标签模块
      5: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod_tag_4_goods_vue/dist/front_page_index.html",
        key: [],
      },
      // 抽奖模块
      6: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod_luck_draw/dist/front_page_index.html",
        key: [],
      },
      // 论坛模块
      7: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod_forum_bbs/dist/front_page_index.html",
        key: [],
      },
      // 待办事项模块
      8: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod_todo_list/dist/front_page_index.html",
        key: [],
      },
      // 商品评价模块
      9: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_sth/dist/front_page_index.html",
        key: [],
      },
      // 体重管理模块
      10: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod_weight_record/dist/front_page_index.html",
        key: [],
      },
      // 纪念日模块
      11: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_anniversary_day/dist/front_page_index.html",
        key: [],
      },
      // 预约模块
      12: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod__reserve_things/dist/front_page_index.html",
        key: [],
      },
      // 投票模块
      13: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod_vote_tool/dist/front_page_index.html",
        key: [],
      },
      // 投票模块
      14: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod_vote_tool/dist/front_page_index.html#/miniProgramJump",
      },
      // 请假模块
      15: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod_oa_process/dist/front_page_index.html",
        key: [],
      },
      // 记账模块
      16: {
        type: "open",
        path:
          "https://jinglintu.downline.cn/004_mobile_web_site_lite_mod_account_book/dist/front_page_index.html",
        key: [],
      },
    },
  },

  /* 首次资源是否加载完成 */
  resource_loaded: false,

  /* 分享信息 */
  share_info: null,

  /* 分享初始化状态 */
  is_init_share: false,

  /* 图片地址 */
  oss_host_url: "http://upload-image.jinglintu.cn",

  /* 未完成订单 */
  unfinish_order_4_user: null,

  public_agent_info: null,

  public_user_info: null,

  /* 按钮权限 */
  AUTH: LocalStorage.read("__AUTH__"),

  /* 模糊搜索 */
  SUGGEST: LocalStorage.read("__SUGGEST__"),

  keepAlivePage: [],
};
